package com.paic.mhis.hcpms.evaluation.evaluationOrg.evaluationIllegal.biz.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.evaluation.evaluationOrg.evaluationIllegal.biz.service.EvaluationOrgIllegalService;
import com.paic.mhis.hcpms.evaluation.evaluationOrg.evaluationIllegal.dao.EvaluationOrgIllegalDao;


@Component("evaluationOrgIllegalService")
public class EvaluationOrgIllegalServiceImpl implements
		EvaluationOrgIllegalService {
	@Autowired
	private EvaluationOrgIllegalDao evaluationOrgIllegalDao;
	@Override
	public Map<String, Object> queryEvaluationOrgIllegal(Map<String, Object> map) {
		
		Map<String,Object>  resultMap=new HashMap<String,Object>();
		List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
		//查询预警次数以及涉及金额
		Map<String,Object> warnData=evaluationOrgIllegalDao.queryEvaluationOrgIllegalWarn(map).get(0);
		//提醒次数
		map.put("process","01");
		Map<String,Object> map01=evaluationOrgIllegalDao.queryEvaluationOrgIllegalWarn(map).get(0);
		map01.put("code", "01");
		map01.put("name","提醒");
		list.add(map01);
		//书面预警次数
		map.put("process", "02");
		Map<String,Object> map02=evaluationOrgIllegalDao.queryEvaluationOrgIllegalWarn(map).get(0);
		map02.put("code", "02");
		map02.put("name","书面预警");
		list.add(map02);
		//约谈预警次数interviewWarnNum
		map.put("process", "04");
		Map<String,Object> map03=evaluationOrgIllegalDao.queryEvaluationOrgIllegalWarn(map).get(0);
		map03.put("code","04");
		map03.put("name","约谈预警");
		list.add(map03);
		//转稽核次数toAuditNum
		map.put("process","03");
		Map<String,Object> map04=evaluationOrgIllegalDao.queryEvaluationOrgIllegalWarn(map).get(0);
		map04.put("code","03");
		map04.put("name","转稽核");
		list.add(map04);
		//其它次数otherNum
		map.put("process", "05");
		Map<String,Object> map09=evaluationOrgIllegalDao.queryEvaluationOrgIllegalWarn(map).get(0);
		map09.put("code", "05");
		map09.put("name","其它");
		list.add(map09);
		warnData.put("list",list);
		//预警
		resultMap.put("warnData",warnData);
		//稽核
		resultMap.put("auditData",evaluationOrgIllegalDao.queryEvaluationOrgIllegalAudit(map).get(0));
		//
		Map<String,Object> illegalWorkers=new HashMap<String,Object>();
		illegalWorkers.put("num", evaluationOrgIllegalDao.queryEvaluationOrgIllegalPersonNum(map));
		map.put("cut12","12");
		illegalWorkers.put("personNum", evaluationOrgIllegalDao.queryEvaluationOrgIllegalPersonNum(map));
		resultMap.put("illegalWorkers",illegalWorkers);
		return resultMap;
	}
	@Override
	public Map<String, Object> queryEvaluationOrgIllegalWarnDetails(
			Map<String, Object> map) {
		Map<String,Object>  resultMap=new HashMap<String,Object>();
		resultMap.put("tableData",evaluationOrgIllegalDao.queryEvaluationOrgIllegalWarnDetails(map));
		return resultMap;
	}
	@Override
	public Map<String, Object> queryEvaluationOrgIllegalAuditDetails(
			Map<String, Object> map) {
		Map<String,Object>  resultMap=new HashMap<String,Object>();
		resultMap.put("tableData",evaluationOrgIllegalDao.queryEvaluationOrgIllegalAuditDetails(map));
		return resultMap;
	}
	@Override
	public Map<String, Object> queryEvaluationOrgIllegalPersonDetails(
			Map<String, Object> map) {
		Map<String,Object>  resultMap=new HashMap<String,Object>();
		resultMap.put("tableData",evaluationOrgIllegalDao.queryEvaluationOrgIllegalPersonDetails(map));
		return resultMap;
	}
}
